package de.grosjohann.android.feuerwehr.domain;

import java.io.Serializable;
import java.util.Date;

import org.json.JSONException;
import org.json.JSONObject;

public class CalendarItem
  implements Serializable {

  private final String headline;
  private final Date startDate;
  private final Date endDate;

  public CalendarItem(JSONObject obj) throws JSONException {
    headline = obj.getString("headline");
    startDate = new Date(obj.getLong("startDate") * 1000);
    endDate = new Date(obj.getLong("endDate") * 1000);
  }

  public String getHeadline() {
    return headline;
  }

  public Date getStartDate() {
    return startDate;
  }

  public Date getEndDate() {
    return endDate;
  }

  @Override
  public String toString() {
    return headline;
  }
}
